Ext.define('ECAT.view.ImgListAll', {
    extend: 'ECAT.view.ImgList',
    requires: ['Ext.data.Store'],
    xtype : 'list_img_all',
    config: {
    	store:	Ext.create('Ext.data.Store',{
    		model: 'ECAT.model.Img',
    		proxy: {
    		    type: 'ajax',
    		    url : 'data.json',
    		    reader: {
    		        type: 'json',
    		        rootProperty: 'imgs'
    		    }
    		},
    		autoLoad: true
    	})
    },
   beforeInitialize: function() {
		this.callParent(arguments);
        this.element.on({
            swipe: 'onSwipe',
            scope: this
        });
        Ext.Viewport.add(Ext.create('ECAT.view.Menu'));
    },
    onSwipe : function(e){
    	if(e.direction == 'right'){
    		 // 隐藏菜单
			 Ext.getCmp('btn_menu').hide();
			 if(Ext.getCmp('buttom_bar')){
				 Ext.getCmp('buttom_bar').hide();
			 }
			 if(Ext.getCmp('top_bar')){
				 Ext.getCmp('top_bar').hide();
			 }
    		 Ext.Viewport.animateActiveItem(
			        Ext.getCmp('homePage'),  
					{  
					    type: 'slide',  
					    direction: 'right',
					    duration : 900  
					}
			    );
    	}
    }
});
